package com.example.emos.wx.exception;

import lombok.Data;

@Data //getter setter通过lomobox插件生成，加个data注解
//自定义异常类，继承RuntimeException
public class EmosException extends RuntimeException{
    private String msg;//保存异常消息
    private int code = 500;//状态码
//重载构造器,构造方法！！
    public EmosException(String msg) {
        //super手动调用父类构造器
        super(msg);
        this.msg = msg;
    }

    public EmosException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public EmosException(String msg, int code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public EmosException(String msg, int code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }

}
